package com.mimosa.common.message;

import java.util.Date;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.OneToMany;
import javax.persistence.OrderBy;
import javax.persistence.Table;

import com.mimosa.common.entity.BaseEntity;

/**
 * 站内消息实体类
 * 
 * @author Mr.bai
 * 
 */
@Entity
@Table(name = "T_SITE_MESSAGE")
public class TSiteMessage extends BaseEntity {

	private String title;
	/** 标题 */

	private String content;
	/** 内容 */

	private String sendUser;
	/** 发送人ID */

	private Date sendDate;
	/** 发送时间 */

	private int messageType;
	/** 消息类型 */

	private int messageFlag;
	/** 消息细分 */

	/** 真实姓名 */
	private String sendUserName;

	/** 封装好的回复信息对象的集合 */
	@OneToMany(mappedBy = "siteMessage", cascade = CascadeType.ALL)
	@OrderBy("replyDate DESC")
	private Set<TMessageReply> tMessageReply;

	/** 封装好的接收信息对象的集合 */
	@OneToMany(mappedBy = "siteMessage", cascade = CascadeType.ALL)
	private Set<TMessageReceiver> tMessageReceiver;

	/** 封装好的附件信息对象的集合 */
	@OneToMany(mappedBy = "siteMessage", cascade = CascadeType.ALL)
	private Set<TMessageAttachment> messageAttachment;

	private String projectId;

	public TSiteMessage() {
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String getSendUser() {
		return sendUser;
	}

	public void setSendUser(String sendUser) {
		this.sendUser = sendUser;
	}

	public Date getSendDate() {
		return sendDate;
	}

	public void setSendDate(Date sendDate) {
		this.sendDate = sendDate;
	}

	public int getMessageType() {
		return messageType;
	}

	public void setMessageType(int messageType) {
		this.messageType = messageType;
	}

	public int getMessageFlag() {
		return messageFlag;
	}

	public void setMessageFlag(int messageFlag) {
		this.messageFlag = messageFlag;
	}

	public Set<TMessageReply> gettMessageReply() {
		return tMessageReply;
	}

	public void settMessageReply(Set<TMessageReply> tMessageReply) {
		this.tMessageReply = tMessageReply;
	}

	public Set<TMessageReceiver> gettMessageReceiver() {
		return tMessageReceiver;
	}

	public void settMessageReceiver(Set<TMessageReceiver> tMessageReceiver) {
		this.tMessageReceiver = tMessageReceiver;
	}

	public Set<TMessageAttachment> getMessageAttachment() {
		return messageAttachment;
	}

	public void setMessageAttachment(Set<TMessageAttachment> messageAttachment) {
		this.messageAttachment = messageAttachment;
	}

	public String getSendUserName() {
		return sendUserName;
	}

	public void setSendUserName(String sendUserName) {
		this.sendUserName = sendUserName;
	}

	public String getProjectId() {
		return projectId;
	}

	public void setProjectId(String projectId) {
		this.projectId = projectId;
	}

}
